<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>后台管理登录</title>
    <link href="../style/css/back/login.css" type="text/css" rel="stylesheet">
    <script src="../style/js/jquery-1.8.3.js" type="text/javascript"></script>
    <script type="text/javascript">
        function login() {
            $.post("../adminLogin/login", $("#loginForm").serialize(), function (res) {
                if (res.code === 201 || res.code === 500) {
                    alert(res.msg);
                } else if (res.code === 200) {
                    window.sessionStorage.setItem("id", res.data.id);
                    window.sessionStorage.setItem("account", res.data.account);
                    //存储用户新文件名 如果已经上传过值不为null 未上传值为null
                    window.sessionStorage.setItem("newFileName", res.data.newFileName);
                    location.replace("admin_main.html");
                }
            }, "json");
        }
    </script>
</head>
<body>

<div class="login">
    <div class="title">后台管理系统</div>
    <div id="darkbannerwrap"></div>

    <form id="loginForm">
        <input name="action" value="login" type="hidden">
        <input name="account" placeholder="账号" type="text">
        <hr class="hr15">
        <input name="password" placeholder="密码" type="password">
        <hr class="hr15">
        <input value="登录" style="width:100%;" type="button" onclick="login()">

    </form>
</div>
</body>
</html>